package cn.marinda.factory;

import cn.marinda.config.*;

/**
 * 配置文件设置工厂
 *
 * @author admin
 * @date 2022/07/07
 */
public class SettingFactory {

    /**
     * 根据名字来获得配置接口
     *
     * @param name 名字
     * @return {@link SettingConfiguration}
     */
    public static SettingConfiguration getSettingFactoryByName(String name){
        SettingConfiguration settingConfiguration = null;
        switch (name){
            case "setting":
                settingConfiguration = SettingConfig.instance;
                break;
            case "mod":
                settingConfiguration = ModConfig.instance;
                break;
            case "server":
                settingConfiguration = ServerConfig.instance;
                break;
            case "plugin":
                settingConfiguration = PluginConfig.instance;
                break;
        }
        return settingConfiguration;
    }
}
